import "./style/style"
import "@/style/index.scss"
import axios from "axios"
import "./iconfont/iconfont.css"
import "../node_modules/swiper/swiper-bundle.js"
import "../node_modules/swiper/swiper-bundle.css"
import imgUrl from "../src/img/1.png"
var h1 = document.createElement("h1")
var imgs = document.createElement("img")
imgs.src = imgUrl;
document.body.appendChild(imgs)
h1.innerHTML = "aaaa"
document.body.appendChild(h1)// document.documentElement
console.log(1111)
let aaa = "我是赵志豪"
var odiv = document.createElement("div")
console.log(3333333)
axios.get("/list").then(res=>{
    console.log(res)
    odiv.innerHTML = res.data.map((item,index)=>{
        return `<li>${item.tit}</li>`
    }).join("")
    document.body.appendChild(odiv)
    const swiperWrapper = document.querySelector('.swiper-wrapper')
    swiperWrapper.innerHTML = res.data.map((v) => {
        return `
        <div class="swiper-slide">
        <img src="${v.img}" />
        </div>
        `
    }).join('')


})
var div1 = document.createElement("div")
div1.innerHTML = `<span class="icon iconfont">&#xe61b;</span>`
document.body.appendChild(div1)
const swiper = document.querySelector('.swiper')
const mySwiper = new Swiper('.swiper', {
    loop: true, // 无缝轮播
    autoplay: true // 自动轮播
})